﻿<%@ Page Title="" Language="C#" MasterPageFile="~/companypart/CompanyMastermaster.master" AutoEventWireup="true" CodeFile="NewDistributer.aspx.cs" Inherits="NewDistributer" meta:resourcekey="PageResource1"%>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ Register Src="~/GoogleMapForASPNet.ascx" TagName="GoogleMapForASPNet" TagPrefix="uc1" %>
<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../jqModal.js" rel="stylesheet" type="text/css" />

<%--    <script src="jquery-1.3.2.min.js" type="text/javascript"></script>--%>
    <script src="../jqModal.js" type="text/javascript"></script>
    <title>إضافة موزع</title>
<script type="text/javascript">

    function there() {

        $("#dialog").jqm({ modal: true }).jqmShow();


    }
    function Sents() {
        var y = document.getElementById('issent');
        y.style.display = "block";

        setTimeout('getback()', 1000);

    }
    function getback() {
        var y = document.getElementById('issent');
        y.style.display = "none";
        window.location = "companypart/NewDistributer.aspx";
    }
       
    </script>
<style type="text/css">
       tr .tabbone4{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:right;
	
}
.adel4{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  right;
}
         .zr3 {
	background-image:url('../images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('../images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
.txt3
{
    border:1px solid black;
    margin-bottom:5px;
    margin-top:5px;
    }
        .req
        {
            color:Red;
        }

        .lok
     {
	display: none;
	color: red;
     }
        
       
      
     .jqmWindow {
    display: none;
    
    position: fixed;
    top: 17%;
    left: 50%;
    
    margin-left: -200px;
    width: 450px;
    
    background-color: #fff;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}


.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 120) + 'px');
}
    .style1
    {
        width: 152px;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div id="issent"  style="color: #004A00; background-color:#B9DA9A; display:none;direction:rtl" >
<h3>تم الحفظ بنجاح</h3>
</div>
 <div class="jqmWindow" id="dialog" dir="rtl">

<%--<a href="#" class="jqmClose" style="background-image:url('../images/close.png');
	 width:39px;
	 height:40px;
	  background-repeat:no-repeat;
	  display:block;
	  float:left;	"></a>--%>
<h3 class="req">
    <asp:Label ID="Label2" runat="server" Text="<%$ Resources:Resource, mapchoice %>"></asp:Label></h3>

<asp:UpdatePanel ID="UpdatePanel8" runat="server"  UpdateMode="Conditional" 
          RenderMode="Block" ChildrenAsTriggers="true"  >
           <ContentTemplate>
    
<table >
<tr>
<td >

 <uc1:GoogleMapForASPNet ID="GoogleMapForASPNet1" runat="server" Longs="46.66614532470703" Lats ="24.7300718141315"  Zoom="12" Width="300px" Height="300px" />
 
 </td>
 </tr>
<tr>
           <td>
         
               <asp:Button  CssClass="zr3" ID="enter" runat="server" Text="انتهاء"  Width="50px" OnClick="enter_Click"/></td>
              
    </tr>
    </table>
    </ContentTemplate>
   <Triggers>
   <asp:PostBackTrigger ControlID="enter" />
   
   </Triggers>
     </asp:UpdatePanel>
</div>
<br />
 <div class="tab3" >
<table dir="rtl" style="width:100%">
<tr>
<td colspan="6" class="he3">
<asp:Localize runat="server" meta:resourcekey="AddnewdistribtuerData"  Text="إضافة بيانات الموزع الجديد"></asp:Localize>


</td></tr>
<tr>
<td style="width:150px; padding:10px;"><asp:Label CssClass="stylelabel3" 
        ID="lblcompanynames" runat="server" 
               Text="اسم الموزع"  meta:resourceKey="lblcompanynames"></asp:Label></td>
<td style="width:5px;"><b  class="req">*</b> </td>
<td style="width:160px;"><asp:TextBox ID="companyname" runat="server" ValidationGroup="go" 
        CssClass="txt3" Width="150px"></asp:TextBox></td>
<td><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ErrorMessage="<%$ Resources:Resource, required %>" 
            ControlToValidate="companyname" ValidationGroup="go" Visible="true"></asp:RequiredFieldValidator></td>
<td></td>

<td>&nbsp;</td>


</tr>


</table>
<asp:UpdatePanel ID="countypanels" runat="server"  ChildrenAsTriggers="true" UpdateMode="Conditional"
         EnableViewState="true" >
        <ContentTemplate>
<table  dir="rtl" style="width:100%">
<tr>
<td  style="width:150px; padding:10px;">
    <asp:Label ID="lblcountry" runat="server" CssClass="stylelabel3" 
        meta:resourceKey="lblcountry" Text="الدولة"></asp:Label>
    </td>
<td style="width:5px;"><b class="req">*</b> 

</td>
<td style="width:160px;">
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT  Name+','+phonecode as names,iso2 FROM dbo.Country where phonecode !=''">
    </asp:SqlDataSource>
    <asp:DropDownList ID="country" runat="server" AutoPostBack="True" 
        CausesValidation="false" CssClass="txt3" DataSourceID="SqlDataSource2" 
        DataTextField="names" DataValueField="iso2" EnableViewState="true" 
        onselectedindexchanged="country_SelectedIndexChanged" style="margin-left: 0px" 
        ValidationGroup="go" Width="150px">
    </asp:DropDownList>
    </td>
<td style="width:50px;">
<asp:Label ID="lblCity" runat="server" CssClass="stylelabel3" 
        meta:resourceKey="lblCity" Text="المدينة"></asp:Label>
</td>
<td><b class="req">*</b></td>
<td>
    <asp:DropDownList ID="city" runat="server" CssClass="txt3" 
        DataSourceID="SqlDataSource3" DataTextField="Name" DataValueField="CityID" 
        ValidationGroup="go" Width="150px">
    </asp:DropDownList>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [City] WHERE ([ISO2] = @ISO2)">
        <SelectParameters>
            <asp:ControlParameter ControlID="country" Name="ISO2" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    </td>

</tr>
</table>
<table  dir="rtl" style="width:100%">
<tr>
<td style="width:150px; padding:10px;">
    <asp:Label ID="lbladdress" runat="server" CssClass="stylelabel3" 
        meta:resourceKey="lbladdress" Text="العنوان"></asp:Label>
    </td>
<td style="width:5px;"><b class="req">*</b> 

</td>
<td style="width:160px;">
    <asp:TextBox ID="address" runat="server" CssClass="txt3" ValidationGroup="go" 
        Width="150px"></asp:TextBox>
    </td>
<td>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
        ControlToValidate="address" ErrorMessage="<%$ Resources:Resource, required %>" 
        ValidationGroup="go"></asp:RequiredFieldValidator>
    </td>
<td></td>
<td>
    <asp:LinkButton ID="LinkButton1" runat="server" meta:resourceKey="LinkButton1" 
        onclick="LinkButton1_Click" Text="اختر العنوان جغرافياُ"></asp:LinkButton>
    
    </td>

</tr>
<tr>
<td style="width:150px; padding:10px;">
    <asp:Label ID="lblpostalcode" runat="server" CssClass="stylelabel3" 
        meta:resourceKey="lblpostalcode" Text="الرقم البريدى"></asp:Label>
    </td>
<td><b class="req">*</b> </td>
<td>
    <asp:TextBox ID="postalcode" runat="server" CssClass="txt3" 
        ValidationGroup="go" Width="150px"></asp:TextBox>
        </td>
<td>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
        ControlToValidate="postalcode" 
        ErrorMessage="<%$ Resources:Resource, required %>" ValidationGroup="go"></asp:RequiredFieldValidator>
        </td>
<td></td>
<td>
    &nbsp;</td>

</tr><tr>
<td style="width:150px; padding:10px;">
    <asp:Label ID="lbltele1" runat="server" CssClass="stylelabel3" 
        meta:resourceKey="lbltele1" Text="هاتف1"></asp:Label>
    </td>
<td><b class="req">*</b> </td>
<td>
    <asp:TextBox ID="tele1" runat="server" CssClass="txt3" ValidationGroup="go" 
        Width="150px"></asp:TextBox>
    <asp:FilteredTextBoxExtender ID="tele1_FilteredTextBoxExtender" runat="server" 
        Enabled="True" FilterType="Numbers" TargetControlID="tele1">
    </asp:FilteredTextBoxExtender>
        </td>
<td><asp:Label ID="code1" runat="server" CssClass="stylelabel3"></asp:Label>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
        ControlToValidate="tele1" ErrorMessage="<%$ Resources:Resource, required %>" 
        ValidationGroup="go"></asp:RequiredFieldValidator>
        
        </td>
<td>
    &nbsp;</td>
<td>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
        ControlToValidate="tele1" ErrorMessage="<%$ Resources:Resource, validphone %>" 
        ValidationExpression="(^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{1})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{2})\D?\D?(\d{3})\D?(\d{4})$)" 
        ValidationGroup="go"></asp:RegularExpressionValidator>
   
        </td>

</tr>
<tr>
<td style="width:150px; padding:10px;">
    <asp:Label ID="lbltele2" runat="server" CssClass="stylelabel3" 
        meta:resourceKey="lbltele2" Text="هاتف2"></asp:Label>
        </td>
<td></td>
<td>
    <asp:TextBox ID="tele2" runat="server" CssClass="txt3" Width="150px"></asp:TextBox>
    <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" 
        Enabled="True" FilterType="Numbers" TargetControlID="tele2">
    </asp:FilteredTextBoxExtender>
        </td>
<td>
    <asp:Label ID="code2" runat="server" CssClass="stylelabel3"></asp:Label>
    </td>
<td>
    &nbsp;</td>
<td>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
        ControlToValidate="tele2" ErrorMessage="<%$ Resources:Resource, validphone %>" 
        ValidationExpression="(^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{1})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{2})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{3})\D?\D?(\d{2})\D?(\d{2})$)" 
        ValidationGroup="go"></asp:RegularExpressionValidator>
   
        </td>

</tr>
<tr>
<td  style="width:150px; padding:10px;">
    <asp:Label ID="lblfax" runat="server" CssClass="stylelabel3" 
        meta:resourceKey="lblfax" Text="الفاكس"></asp:Label>
        </td>
<td></td>
<td>
    <asp:TextBox ID="fax" runat="server" CssClass="txt3" Width="150px"></asp:TextBox>
    <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" 
        Enabled="True" FilterType="Numbers" TargetControlID="fax">
    </asp:FilteredTextBoxExtender>
        </td>
<td>
    <asp:Label ID="code3" runat="server" CssClass="stylelabel3"></asp:Label>
    </td>
<td>
    &nbsp;</td>
<td>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
        ControlToValidate="fax" ErrorMessage="<%$ Resources:Resource, validphone %>" 
        ValidationExpression="(^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{1})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{2})\D?\D?(\d{3})\D?(\d{4})$)|(^\D?(\d{3})\D?\D?(\d{2})\D?(\d{2})$)" 
        ValidationGroup="go"></asp:RegularExpressionValidator>
    
        </td>

</tr>
</table>
       
      </ContentTemplate>
        <Triggers>
           <asp:PostBackTrigger ControlID="LinkButton1" />
        </Triggers>
      </asp:UpdatePanel>

<table dir="rtl" style="width:100%">
<tr>
<td   style="width:150px; padding:10px;">  <asp:Label CssClass="stylelabel3"  ID="lblemail1" runat="server" Text="بريد الكترونى " meta:resourceKey="lblemail1"></asp:Label></td>
<td style="width:5px;"><b class="req">*</b> </td>
<td style="width:160px;">
         <asp:TextBox ID="email1" runat="server" ValidationGroup="go"  CssClass="txt3" 
             Width="150px"></asp:TextBox>
   
        </td>
<td>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
            ErrorMessage="<%$ Resources:Resource, required %>" 
             ControlToValidate="email1" ValidationGroup="go"></asp:RequiredFieldValidator>
 
       </td>
<td></td>
<td>
 
       <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
            ErrorMessage="<%$ Resources:Resource,validemail %>" ControlToValidate="email1" 
            
            
             ValidationExpression="^((([a-z]|[0-9]|!|#|$|%|&amp;|'|\*|\+|\-|/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&amp;|'|\*|\+|\-|/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.(af|ax|al|dz|as|ad|ao|ai|aq|ag|ar|am|aw|au|at|az|bs|bh|bd|bb|by|be|bz|bj|bm|bt|bo|ba|bw|bv|br|io|bn|bg|bf|bi|kh|cm|ca|cv|ky|cf|td|cl|cn|cx|cc|co|km|cg|cd|ck|cr|ci|hr|cu|cy|cz|dk|dj|dm|do|ec|eg|sv|gq|er|ee|et|fk|fo|fj|fi|fr|gf|pf|tf|ga|gm|ge|de|gh|gi|gr|gl|gd|gp|gu|gt| gg|gn|gw|gy|ht|hm|va|hn|hk|hu|is|in|id|ir|iq|ie|im|il|it|jm|jp|je|jo|kz|ke|ki|kp|kr|kw|kg|la|lv|lb|ls|lr|ly|li|lt|lu|mo|mk|mg|mw|my|mv|ml|mt|mh|mq|mr|mu|yt|mx|fm|md|mc|mn|ms|ma|mz|mm|na|nr|np|nl|an|nc|nz|ni|ne|ng|nu|nf|mp|no|om|pk|pw|ps|pa|pg|py|pe|ph|pn|pl|pt|pr|qa|re|ro|ru|rw|sh|kn|lc|pm|vc|ws|sm|st|sa|sn|cs|sc|sl|sg|sk|si|sb|so|za|gs|es|lk|sd|sr|sj|sz|se|ch|sy|tw|tj|tz|th|tl|tg|tk|to|tt|tn|tr|tm|tc|tv|ug|ua|ae|gb|us|um|uy|uz|vu|ve|vn|vg|vi|wf|eh|ye|zm|zw|com|edu|gov|int|mil|net|org|biz|info|name|pro|aero|coop|museum|arpa))|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$" 
             ValidationGroup="go"></asp:RegularExpressionValidator>
 
       </td>
</tr>
<tr>
<td style="width:150px; padding:10px;"> 
         <asp:Label CssClass="stylelabel3"  ID="lblusername" runat="server" 
             Text="الموقع الالكترونى" meta:resourceKey="wesite"></asp:Label></td>
<td></td>
<td>
         <asp:TextBox ID="username" runat="server" ValidationGroup="go"  CssClass="txt3" 
             Width="150px"></asp:TextBox>
   
        </td>
<td></td>
<td></td>
<td>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
              ControlToValidate="username"  
             ErrorMessage="<%$ Resources:Resource, validsite %>" 
             ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?" 
             ValidationGroup="go"  ></asp:RegularExpressionValidator>
  </td>
</tr>



</table>
<table dir="ltr" >
   
   <%-- <tr>
    <td align="right"   >
    
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ErrorMessage="<%$ Resources:Resource, required %>" 
            ControlToValidate="surname" ValidationGroup="go" Visible="False"></asp:RequiredFieldValidator>
          <asp:validatorcalloutextender runat="Server" id="Validatorcalloutextender1" targetcontrolid="RequiredFieldValidator2"
                                                    highlightcssclass="validatorCalloutHighlight"  PopupPosition="TopLeft"  />
            </td>
   <td align="right"  >  <asp:TextBox ID="surname" runat="server" ValidationGroup="go"></asp:TextBox></td>
     <td align="right" class="style1"  ><b  class="req">*</b>  <asp:Label CssClass="stylelabel3"  ID="lblorgdescs" runat="server" Text="وصف الجهة" meta:resourceKey="lblorgdescs"></asp:Label>
     </td> 
    </tr>--%>
  <%--  <tr >
    
    
    
    <td align="right"  >
       
     </td>
     <td align="right"  >
     <div dir="rtl" align="right"  >
         <asp:DropDownList ID="orgtype" runat="server" DataSourceID="orgs" 
             DataTextField="organization" DataValueField="id">
            
         </asp:DropDownList>
                    <asp:SqlDataSource ID="orgs" runat="server" 
             ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
             SelectCommand="SELECT * FROM [organizations]"></asp:SqlDataSource>
                    </div>
           </td>
         <td align="right" class="style1"  >  
         <b  class="req">*</b>  
    <asp:Label CssClass="stylelabel3"  ID="lblorganization_id" runat="server" Text="نوع الجهة" meta:resourceKey="lblorganization_id"></asp:Label>
   </td>
   </tr>--%>
   
   
    
   
    <tr align="right" >
   
    <td align="right"  colspan="3">
    
    
    </td>
    
    </tr>
    
     
    <tr><td  colspan="3">
     <div  align="right" >
       <asp:UpdatePanel ID="mains" runat="server" ChildrenAsTriggers="true">
        </asp:UpdatePanel>
    </div>
    </td></tr>
     <tr>
    <td colspan="2" dir="rtl" >
    
      
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" class="req3" 
            style="text-align: right" />
    </td>
    <td align="right" class="style1"  >
        &nbsp;</td>
    </tr>
    <tr>
    <td></td>
    <td  align="center">
    
        
    <asp:Button  CssClass="zr3" ID="save" runat="server" style="text-align: center" 
        Text="حفظ" onclick="save_Click" Width="44px" ValidationGroup="go" meta:resourceKey="save" />
       
    </td>
    <td class="style1"></td>
    </tr>
    </table>
    <br />
    </div>
  
    


</asp:Content>

